<?php defined('_JEXEC') or die('Restricted access'); // no direct access ?>
<?php 
	$tweetStatus = '';
	
	$scriptUrl1 = "http://bit.ly/javascript-api.js?version=latest&login=tweettrackjs&apiKey=";
	$scriptUrl2 = "http://s.bit.ly/TweetAndTrack.js?v=1.01";
	$styleUrl = "modules/mod_tweet_this/tmpl/css/default.css";
	$doc = &Jfactory::getDocument();
	
	// add tweet this style sheet to <head>
	$doc->addStyleSheet($styleUrl);
	
?>
<center>
	<?php if($useBitly) { 
	    // add bit.ly script to <head>
		$doc->addScript($scriptUrl1.$bitlyApi,'text/javascript'); 
		$doc->addScript($scriptUrl2); ?>
	<a href="#" onclick="return TweetAndTrack.open(this, '<?php echo $shortenUrl ?>');">
		<div class="tweetthis">
			<span style="display:none;"><?php echo $customMsg.' '.$docTitle.' '.$hashTags ?></span>
			<img src="../modules/mod_tweet_this/tmpl/images/<?php echo $tweetImage ?>" class="tweetthis" />
			<?php echo JText::_('TWEET THIS'); ?>
		</div>
	</a>
	<?php } else { 
		$tweetStatus = $customMsg.' '.urlencode($shortenUrl).' '.urlencode($hashTags);
	?>
	<a href="http://twitter.com/home/?status=<?php echo $tweetStatus ?>">
		<div class="tweetthis">
			<img src="../modules/mod_tweet_this/tmpl/images/<?php echo $tweetImage ?>" class="tweetthis" />
			<?php echo JText::_('TWEET THIS'); ?>
		</div>
	</a>
	<?php } ?>
</center>
